OB.Emes_ActionButton = OB.Emes_ActionButton || {};

//产量信息微信推送
OB.Emes_ActionButton.SendWxMsg = function(d, b) {
	this.sendWxMsgForm = isc.DynamicForm.create({
		ID: "sendWxMsg",
		canEdit: true,
		width: "100%",
		height: 100,
		fields: [
			{title: '推送日期', name: 'selDate',type: 'date', readOnlyDisplay: "static", canEdit: true, startRow: false},
			{title: '班次', name: 'selShift', type: 'select',value:'day',valueMap: {day:'白班', night: '晚班'},readOnlyDisplay: "static", canEdit: true, startRow: false}
		]
	});
	
	selfDef_Window = isc.Window.create({
		id: "selfDef_Window",
		width: 320,
		height: 200,
		title: '微信消息推送',
		canDragResize: false,
		canDragReposition: true,
		showCloseButton: true,
		showMinimizeButton: false,
		autoCenter:true,
		autoSize:true,
		isModal:true,
		closeClick:function(){
			selfDef_Window.destroy();
		},
		items: [
			isc.VLayout.create({
				width: "100%",
				height: "200",
				align: "center",
				members: [
					this.sendWxMsgForm,
					isc.HLayout.create({
						width: "100%",
						height: "30",
						align: "center",
						padding: 5,
						members: [
							isc.OBFormButton.create({
								title : '确认推送',
								popup : this,
								action : function() {
									isc.confirm("确定推送信息？", function(bool){
										if (bool) {
											sendWxMsg.saveData();
											var selDate = sendWxMsg.getValue("selDate");
											var selShift = sendWxMsg.getValue("selShift");
											var callback = function(response, data, request){
												isc.showMessage(data.message);
												selfDef_Window.close();
											};
											OB.RemoteCallManager.call("com.mes.handler.SendWxMsgButtonHandler", 
													{selDate:selDate,selShift:selShift} , {}, callback);
										}
									});
								}
							})
						]
					})
				]
			})
		]
	});
	//弹出确认框
	selfDef_Window.show();
};
